
$(document).ready(function() {
    menuClass("area-academica");
} );

function back(){
    $("#areaacademica-form").reset();
    window.location.href='/admin/areaacademica/';
}

function nuevo(){
    window.location.href='/admin/areaacademica/edit';
}

function hideAlert(id, time){
    $("#" + id).hide(time);
}

$("#success").show(500);

setTimeout("hideAlert('success', 500)",5000);
                                
function eliminar(id){
    $.blockUI({
        message: "Eliminando..."
    });
    $.ajax({
        url:'/admin/areaacademica/delete',
        data: 'id=' + id,
        dataType: 'json',
        success:function(data){
            $("#area_table").dataTable().fnDraw();
            if(data.tipo == 'error'){
            // desplegar mensaje de error
            }else if(data.tipo == 'success'){
            // desplegar mensaje de success
            }
            $.unblockUI();
        }
            
    });
}